.PHONY:all
# all:server cgi_index cgi_login cgi_logon cgi_modify cgi_admin cgi_display cgi_userSearch  cgi_newsforuser cgi_logout cgi_state
all:server 

CFLAGS=-w -std=c++11 -lpthread -lmysqlclient  -lctemplate #-lboost_filesystem -lboost_system


server:http_server_main.cpp http.cpp
	g++ -o  $@ $^ -std=c++11 -lpthread -g 

cgi_index:./cgi/cgi_index.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS) 
	mv cgi_index ./MyRootDir/

cgi_login:./cgi/cgi_login.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_login ./MyRootDir/

cgi_logon:./cgi/cgi_logon.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_logon ./MyRootDir/

cgi_logout:./cgi/cgi_logout.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_logout ./MyRootDir/

cgi_modify:./cgi/cgi_modify.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_modify ./MyRootDir/

cgi_admin:./cgi/cgi_admin.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_admin ./MyRootDir/

cgi_display:./cgi/cgi_display.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_display ./MyRootDir/

cgi_userSearch:./cgi/cgi_userSearch.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_userSearch ./MyRootDir/

cgi_adminSearch:./cgi/cgi_adminSearch.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_adminSearch ./MyRootDir/

cgi_newsforuser:./cgi/cgi_newsforuser.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_newsforuser ./MyRootDir/

cgi_state:./cgi/cgi_state.cpp http.cpp
	g++ -o  $@ $^  $(CFLAGS)
	mv cgi_state ./MyRootDir/

.PHONY:clean
clean:
	rm server ./MyRootDir/cgi*
